[ Home ] [ Authors ] [ Index ] [ Abbreviations ] [ Bindings ]

TopLevel Class

Top-level windows in Tycho are all derived from a common baseclass that provides some rudimentary capabilities. To create a top-level window with a specified geometry, you can use the following pair of commands:

::tycho::TopLevel .t -geometry 300x300+0+0
wm deiconify .t
Most top-level window widgets in Tycho do not automatically appear on the screen. The reason for this is that most widgets are designed to be building blocks, and when the constructor runs, it can't be sure whether everything that is going to be packed into the window has been packed into the window. Thus, the window is created in withdrawn state to prevent the visually distracting artifact of a window appearing and then having widgets added to it. The deiconify method above tells the window manager to make the window visible.

Alternatively, instead of the "wm deiconify" method, we could have requested that the window be centered on the screen using the centerOnScreen method:

.t centerOnScreen

You can prevent interactive resizing of the window with the following command. Before you execute it, verify that you can interactively resize the window we have created using whatever mechanism your window manager supports. Then do this, use the freezeWindowSize method:

.t freezeWindowSize
and try again to resize.

You can also move or resize the window by configuring its geometry option:

.t configure -geometry 100x100-0+0
To remove the window, simply do:
delete object .t

Copyright © 1996, The Regents of the University of California. All rights reserved.
Last updated: 96/04/09, comments to: eal@eecs.berkeley.edu